package com.sunl.mall.common.util;

import java.util.Collection;
import java.util.Map;

public class CollectionUtil {
    private CollectionUtil(){}

    public static boolean isEmpty(Object object) {
        return object == null;
    }

    public static boolean isEmpty(Boolean b) {
        return !b;
    }

    public static boolean isEmpty(String string) {
        return string == null || string.equals("");
    }

    public static boolean isEmpty(Long l) {
        return l == null || l < 1L;
    }

    public static boolean isEmpty(Integer i) {
        return i == null || i < 1;
    }

    public static boolean isEmpty(Collection collection) {
        return collection == null || collection.isEmpty();
    }

    public static boolean isEmpty(Map map) {
        return map == null || map.isEmpty();
    }

    public static boolean isNotEmpty(Collection<?> collection) {
        return !isEmpty(collection);
    }

    public static boolean isNotEmpty(Map<?, ?> map) {
        return !isEmpty(map);
    }

}
